<template>
  <div>
    <w-export-excel
      :excel-type="excelType"
      :select-rows="selectRows"
      title="导出数据"
      type="warning"
      xlsx-name="exportExcelDemo2"
    />
  </div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'

const selectRows = ref<Array<any>>([
  {
    name: 'un',
    stuInfo: {
      name: 'under1',
      classOrgName: '2班',
      gradeOrg: {
        name: '一年级',
      },
    },
    scores: 100,
    level: 'A',
  },
  {
    name: 'sun',
    stuInfo: {
      name: 'under2',
      classOrgName: '2班',
      gradeOrg: {
        name: '二年级',
      },
    },
    scores: 86,
    level: 'B',
  },
  {
    name: 'json',
    stuInfo: {
      name: 'under3',
      classOrgName: '3班',
      gradeOrg: {
        name: '一年级',
      },
    },
    scores: 75,
    level: 'C',
  },
])

const excelType: any = {
  'stuInfo.name': '姓名B',
  name: '姓名A',
  stuInfo: {
    // name: '姓名A',
    typeJoin: {
      classOrgName: '班级',
      value: ['gradeOrg.name', 'classOrgName'],
    },
  },
  scores: '得分',
  level: '级别',
}
</script>